tic tac toe — Home

Tic Tac Toe

Parent Note (Up)

Introduction

Tic tac toe, noughts and crosses, or whatever you may call this game, it’s about as basic as it gets. The game is a school backbencher favourite, and for good reason too.

  • The game is incredibly easy to learn & play.
  • It gets over within a couple of minutes.
  • It’s in the perfect middle ground of fun vs mentally challenging for those new to strategy games.

Before we get straight into the game, it's usually a little fun to learn about its origins. Aurosi's blog has been my first point of information about the game's history.
The ancient Roman's played a game called "terni lapilli", which translates to "three pebbles at a time" or "three little stones". Terni lapilli is in fact a little more complicated and involved than tic tac toe. While the end goal is similar, each player has only 3 pebbles each. In each turn they can move them around, and try to create a winning pattern.
Around the mid 1800s the British started using the name noughts and crosses, which should be self explanatory. I haven't been able to find too clear a history of how and why the game transformed from the time of the ancient Romans till date. But the version played by the British in the 1800s has spread with pretty much the same rules to most parts of the world. And by the 20th century the game was commonly referred to as tic-tac-toe in the United States. Once again, I wasn't able to find too clear a story behind the American name. But the cutest name for the game that I found was "twiddles and bears", which I believe is what it's called in Norway.

Rules

The rules of tic tac toe are pretty straightforward. But because it's always possible to follow a slightly different variant of a game, I have decided to use exploratorium's webpage as a sort of reference point.

Player Dynamics

The game is usually played by 2 players (opponents), with one playing against the other. One player could also play against a computer. And of course 2 computers could play against each other, if you're working on an introductory coding project.
Each player has a different symbol (either X or O) which is theirs for the game.

Turn Systems

It's a turn based game. Each player gets to play exactly one game action, and then it's the opponents turn. This cycle repeats till the game is over.
A few websites tell me that X always starts the game.

Game Actions

The game is played on a 3x3 grid of empty squares (image below), which is usually drawn on a piece of paper. On each player's turn they may pick from any of the squares which are still empty, and draw their symbol in it.

Objective

To fill a "winning pattern" in the grid before the game ends. A winning pattern consists of 3 of your symbols (X or O) in a row. The below image shows the possible winning arrangements for Xs (without the Os).
The game ends when either one player completes a winning pattern or all squares are filled, but no player has won (draw).

Determinism

Tic tac toe is a perfectly deterministic game. This means that there is no element of luck, and the moves deliberately made by each player entirely define and determine the outcome of the game.

Analysis

The most interesting part of any game for me is figuring out how I can win. The more fundamental question is perhaps whether either player can have a strategy which will ensure that they win. There are broadly 3 possibilities when each player plays their best possible game:

  1. X always wins
  2. O always wins
  3. The game is always drawn

To figure out how tic tac toe plays out, one can create a state tree of all possible situations in the game. This state tree will always end in the 3 possible outcomes. One can then recursively work backwards to figure out whether either player can always win tic tac toe, or whether it will always end in a draw, when both players play at their best. I have laid out the approach to analyse the game in much more detail in a medium article .

End of Note

Notes mentioning this note